﻿using System;
using FluentPS.Enums;

namespace FluentPS.Attributes
{
    [AttributeUsage(AttributeTargets.Property)]
    public class PSCustomFieldAttribute : PSFieldAttribute
    {
        public const int MaxCustomeFieldNameLength = 50;

        public PSCustomFieldAttribute(string fieldUid)
            : base(fieldUid)
        {
            IsRequired = false;
        }

        public PSCustomFieldAttribute(string fieldUid, string fieldName)
            : this(fieldUid)
        {
            FieldName = fieldName;
        }

        public PSCustomFieldAttribute(string fieldUid, string fieldName, bool isRequired)
            : this(fieldUid, fieldName)
        {
            IsRequired = isRequired;
        }

        public bool IsRequired { get; set; }
        public string FieldName { get; set; }
        public string Description { get; set; }
        public bool IsMultiline { get; set; }
        public PSFieldType FieldType { get; set; }
    }
}
